package com.example.rocketmq.service;


import com.situ.model.Order;
import com.situ.model.OrderItem;
import com.situ.utils.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "skymall-gateway")public interface OrderFeignService {

    @PostMapping("/order-api/api/v1/order/seckill_order")
    ResponseEntity<JsonResult<Order>> createSeckillOrder(@RequestBody Order order);


    //根据主键查询，无缓存
    @GetMapping("/order-api/api/v1/order/id/{id}")
    ResponseEntity<JsonResult<Order>> findById(@PathVariable Integer id);
    //修改订单
    @PutMapping("/order-api/api/v1/order/statusTo4/{id}")
    ResponseEntity<JsonResult<?>> updateOrderStatusTo4(@PathVariable Integer id);


    //查询指定订单的所有订单项
    @GetMapping("/order-api/api/v1/order_items/order_id/{orderId}")
    ResponseEntity<JsonResult<List<OrderItem>>> findOrderItemsByOrderId(@PathVariable Integer orderId);

}
